<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
 <%@include file="../common/jspcommon.jsp"%>
    <title>活动-笔飞美术作品</title>
    <link rel="stylesheet" type="text/css" href="/css/style_hd.css" />
     <link rel="stylesheet" type="text/css" href="/css/pager.css" />
   <link rel="stylesheet" type="text/css" href="/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="/css/nivo-slider.css" />
    <link rel="stylesheet" type="text/css" href="/css/style_index.css" />
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script src="/third/lib/jquery-validation/jquery.validate.min.js" type="text/javascript"></script> 
    <script src="/third/lib/jquery-validation/jquery.metadata.js" type="text/javascript"></script>
	<script src="/third/lib/jquery-validation/messages_cn.js" type="text/javascript"></script>
    <script type="text/javascript">
	$(function() {
		$("#signup_form").validate({
			success : function(label) {
				label.text("").addClass("validate_success");
			},
			rules : {
				name : {
					required : true,
					minlength : 2,
					maxlength : 20
				},
				telphone : {
					required : true,
					number:true
				},
				phone : {
					required : true,
					number:true
				},
				email : {
					required : true,
					email :true
				},
				content : {
					required : true,
					minlength : 2,
					maxlength : 200
				}
				

			},
			messages : {
				name : {
					required : "请输入姓名",
					minlength : "请填写2个以上字",
					maxlength : "请填写20个以下的字"
				},
				telphone : {
					required : "请输入固定电话号码",
					minlength : "请填写2个以上字",
					maxlength : "请填写20个以下的字"
				},
				phone : {
					required : "请输入手机号码",
					minlength : "请填写2个以上字",
					maxlength : "请填写20个以下的字"
				},
				email : {
					required : "请输入邮箱",
					minlength : "请填写2个以上字",
					maxlength : "请填写20个以下的字"
				} ,
				content : {
					required : "请输入留言",
					minlength : "请填写2个以上字",
					maxlength : "请填写200个以下的字"
				}

			},
			submitHandler : function() {
				$.post("signupmember.htm", {
					activityId:$("#activityId").val(),
					membername:$("#name").val(),
					telphone:$("#telphone").val(),
					phone:$("#phone").val(),
					email:$("#email").val(),
					content:$("#content").val()
				}, function(data) {
					if (data == "success") {
						alert("报名成功！");
						
						window.location.href="/mActivity.htm";
					}
					if (data == "error") {
						alert("抱歉，参加活动失败，人员已满！");
					}
				});
			}
		});
	});
	
	function login(){
		alert("请登录！");
	}
	</script>
</head>

<body>
<div id="box">
	<%@include file="../common/header.jsp" %>
    <div id="main_div2">
        <div class="site_map"><a href="/welcome.htm">首页</a> 》活动</div>
        
        <div class="main_div2_left">
            <div class="category">
            <h2>活动</h2>
           <ul>
                <li class="cur"><a href="activtylb.htm?type=0">- 作品征集</a></li>
                <li><a href="activtylb.htm?type=1">- 拍卖</a></li>
                <li><a href="activtylb.htm?type=2">- 公益</a></li>
                <li><a href="activtylb.htm?type=3">- 户外写生</a></li>
            </ul>
            </div>
        </div>
        <div class="main_div2_right">
        <form  method="post" id="signup_form" action="">
            <table cellpadding="10" cellspacing="0" class="member_table3">
            <tr>
                <td colspan="2" class="td11">
                    <span class="style5">活动报名</span>
                    <span class="style6 fr">* 为必填项</span>
                </td>
            </tr>
            <tr>
                <td colspan="2"></td>
            </tr>
            <tr>
                <td style="width:80px; text-align:right;">*姓名：</td>
                <td align="left"><input type="text" class="input1" name="name" id="name" />
                <input type="hidden"  name="activityId" id="activityId" value="${activityId}" />
                </td>
            </tr>
            <tr>
                <td style="text-align:right;">*电话：</td>
                <td align="left"><input type="text" class="input1" name="telphone" id="telphone" />
                <br/>
                                                示例:02100000000
                </td>
            </tr>
            <tr>
                <td style="text-align:right;">*手机：</td>
                <td align="left"><input type="text" class="input1" name="phone" id="phone" /></td>
            </tr>
            <tr>
                <td style="text-align:right;">*邮箱：</td>
                <td align="left"><input type="text" class="input1" name="email" id="email" /></td>
            </tr>
            <tr>
                <td style="text-align:right;" valign="top">*留言：</td>
                <td align="left"><textarea name="content" cols="65" rows="8" id="content"></textarea></td>
            </tr>
            <tr>
                <td></td>
               <c:if test="${onlineUser.member!=null }"> <td align="left"><input type="submit" name="" value="" class="btn_tj"/></td></c:if>
                 <c:if test="${onlineUser.member==null }"> <td align="left"><input type="button" name="" value="" class="btn_tj" onclick="login();"/></td></c:if>
            </tr>
            
            </table>
           </form>
        </div>
       <%@include file="../common/footer.jsp" %>
    </div>
    
    
</div>

</body>
</html>
